# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Sheets.V4.Model.DataSourceSpec do
  @moduledoc """
  This specifies the details of the data source. For example, for BigQuery, this specifies information about the BigQuery source.

  ## Attributes

  *   `bigQuery` (*type:* `GoogleApi.Sheets.V4.Model.BigQueryDataSourceSpec.t`, *default:* `nil`) - A BigQueryDataSourceSpec.
  *   `looker` (*type:* `GoogleApi.Sheets.V4.Model.LookerDataSourceSpec.t`, *default:* `nil`) - A LookerDatasourceSpec.
  *   `parameters` (*type:* `list(GoogleApi.Sheets.V4.Model.DataSourceParameter.t)`, *default:* `nil`) - The parameters of the data source, used when querying the data source.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigQuery => GoogleApi.Sheets.V4.Model.BigQueryDataSourceSpec.t() | nil,
          :looker => GoogleApi.Sheets.V4.Model.LookerDataSourceSpec.t() | nil,
          :parameters => list(GoogleApi.Sheets.V4.Model.DataSourceParameter.t()) | nil
        }

  field(:bigQuery, as: GoogleApi.Sheets.V4.Model.BigQueryDataSourceSpec)
  field(:looker, as: GoogleApi.Sheets.V4.Model.LookerDataSourceSpec)
  field(:parameters, as: GoogleApi.Sheets.V4.Model.DataSourceParameter, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Sheets.V4.Model.DataSourceSpec do
  def decode(value, options) do
    GoogleApi.Sheets.V4.Model.DataSourceSpec.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Sheets.V4.Model.DataSourceSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
